Auto-focusing system for video camera

ABSTRACT

An auto-focusing system for a video camera using the focus signal extracted by a focus signal extracting device from high-frequency components of the video signal. A gate circuit is provided in front of the focus signal extracting device and the gate circuit is made conductive or non-conductive depending on the magnitude of the focus signal thereby to control the quantity of the video signal received by the focus signal extracting device, whereby the dynamic range of the focus signal extracting device is virtually expanded.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an auto-focusing system and,particularly, to an auto-focusing system for a video camera.

2. Description of the Prior Art

It is known, as a method of auto-focusing by utilization of theproperties of the video camera, the step-by-step control method whereinthe definition of the picture is detected using high frequencycomponents of the video signal and the distance setting ring (will betermed "helicoid" hereinafter) of the lens is rotated under control soas to obtain the best definition. This method is described in detail inan article entitled, "Automatic Focus Adjustment for TV Camera byStep-by-step Servo System", by Ishida et al., NHK Technical Report, Vol.17, No. 1 (1965), Serial No. 86, page 21. This method will first beexplained briefly in connection with FIGS. 1 and 2.

FIG. 1 shows in block diagram the arrangement of the auto-focusingsystem using the step-by-step control method. The arrangement includes alens system 1, a camera circuit 2, a video signal output terminal 3, ahigh-pass filter (HPF) 4, a detector 5, a difference holding circuit(serves as the combination of a differential circuit and a sampleholding circuit) 6, a motor drive circuit 7, and a motor 8 for turningthe helicoid in the lens system 1.

The operation of the arrangement shown in FIG. 1 will be describedreferring to the characteristic graphs in FIG. 2. The incident ray froman object is focused by the lens system 1, then converted into theelectrical signal by the camera circuit 2, which provides at theterminal 3 the video signal for the object. The high-pass filter (HPF) 4extracts high frequency components of the video signal and the detector5 detects the high frequency components and provides a voltage signal atterminal 51. Since the voltage at the terminal 51 (will be termed "focussignal": curve (1) in FIG. 2) represents the definition of the picture,it becomes maximum when the helicoid position (A) of the lens system 1is set exactly corresponding to the distance between the object and thelens system 1, while it decreases as the helicoid setting deviates fromthe object distance. In FIG. 2, curves (2) and (3) show the outputsignal level at terminal 61 when the helicoid position is moved fromproximity to infinity and from infinity to proximity, respectively.

FIG. 2 suggests that if the helicoid position is controlled by somemeans as if one ascends the slope of the focus signal curve so as tolead the helicoid position to the peak where the focus signal has themaximum value, then automatic focusing will be achieved. This process iscarried out by the circuit portion including the difference holdingcircuit 6, the motor drive circuit 7 and the motor 8 in FIG. 1. Themotor 8 moves the helicoid position, while the difference holdingcircuit 6 samples and holds the focus signal on the terminal 51 at acertain interval and provides a positive voltage if the sampled signalsshow a positive variation (i.e. ascent) or provides a negative voltageif the sampled signals show a negative variation (i.e. descent). Themotor drive circuit 7 keeps the turning direction of the motor 8 toascend the slope of curve when the difference holding circuit 6 providesa positive voltage, or reverses the turning direction to take theascending direction when the circuit 6 provides a negative voltage. Thusthe helicoid position control loop shown in FIG. 1 leads the helicoidposition to ascend the slope of the focus signal by referring to theoutput voltage of the difference holding circuit 6, and eventually thehelicoid position will zigzag to the peak of the curve. By detecting thearrival at the peak point, the lens position is fixed and auto-focusingis completed.

The auto-focusing system by step-by-step control for a video camera hasbeen described. This method uses the picture signal to carry out thefocusing operation and realize an inexpensive and accurate auto-focusingsystem with the simpler structure and less initial adjustments ascompared with the system having a closed-loop helicoid position controlbased on an independent distance metering device. However, the foregoingmethod has the following problems related to the dynamic range of thefocus signal. The amplitude of the video signal from the camera circuit2 is controlled to have a constant level by the automatic or manual gaincontrol circuit within the camera circuit 2, while the output of thedetector 5 is responsive to the amount of high frequency componentsincluded in the video signal, i.e., energy included in the output of theHPF 4. Therefore, if the picture has little high-contrast vertical linecomponents, the detector 5 receives from the HPF 4 a less number ofpulses with small amplitude, resulting in a small peak on the curve ofthe focus signal. On the other hand, if the picture has muchhigh-contrast vertical line components, the detector 5 receives a largenumber of pulses with larger amplitude, resulting in a large peak on thecurve of the focus signal. In the actual picture signal, there is agreat difference between these peaks, that extends, according to anexperiment, about 1 to 200.

Since the dynamic range of the focus signal is limited mainly by thepower voltage, the detector 5 is designed so that it is not saturatedfor the abovementioned higher peak. Therefore, the detector 5 provides alower voltage for a picture having less vertical line components,causing the difference holding circuit 6 to fail to operate, and thecircuit does not provide the output voltage responsive to the full rangeof the focus signal. Conversely, if the detector 5 is designed so as toprovide a sufficient output voltage for a picture having less verticalline components, it will be saturated by a high-contrast picture,resulting in a flattened peak on the curve of the focus signal. Also inthis case, the difference holding circuit 6 does not receive a correctsignal, and the accurate ascending operation cannot be expected.

SUMMARY OF THE INVENTION

It is an object of the present invention to solve the foregoing priorart deficiencies and provide an auto-focusing system which performs asatisfactory step-by-step operation irrespecitve of the amount ofvertical line components in the picture.

It is another object of the invention to solve the foregoing prior artdeficiencies and provide an auto-focusing system for a video cameracapable of satisfactory focusing for any object.

According to one aspect of the present invention, there is provided anauto-focusing system comprising a video camera and a focus signalextracting means which receives the video signal produced by the videocamera and provides a focus signal representing the focal matching ofthe lens system, the focus signal being used to control the lens systemof the video camera, the system further comprising a gate circuitprovided in front of or inside the focus signal extracting means and thegate is operated so that the amount of the video signal entered to thefocus signal extracting means is controlled. The operation mentionedabove is equivalent to the automatic gain control for a detector meanswithin the focus signal extracting means. The gate is made conductive ornon-conductive depending on the amount of high-frequency components inthe video signal, and the amount of the high-frequency components isdetermined by counting the number of profiles in the picture or obtaineddirectly from the output of the focus signal extracting means.

According to the invention, video signals supplied to the focus signalextracting means is picked off depending on the amount of thehigh-frequency components in the video signal thereby to prevent thesaturation of the detector means. Preferably, video signals are reducedin units of horizontal scanning lines, and the gate circuit iscontrolled to conduct all horizontal scanning lines, conduct every twolines or conduct every 3-64 lines depending on the amount of thehigh-frequency components in the video signal. In estimating the amountof high-frequency components, the number of profiles in a picture in thevideo signal is counted, for example, over one field period, oralternatively, the output of the focus signal extracting means iscompared with a predetermined threshold value by a threshold circuit.The threshold circuit is preferably constituted by a first circuithaving a threshold value in proximity of the saturation level of thefocus signal extracting means and a second circuit having a thresholdvalue in proximity of the null signal level. According to the invention,the threshold values of the threshold circuits are set automaticallywhen the auto-focusing operation is initiated.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing the conventional auto-focusing system;

FIG.2 is a graphical representation explaining the principle ofoperation of the arrangement shown in FIG. 1;

FIG. 3 is a block diagram showing an embodiment of the presentinvention;

FIGS. 4A and 4B are illustrations useful to explain the gain control ofthe present invention;

FIG. 5 is a block diagram showing another embodiment of the invention;

FIG. 6 is a graphical representation explaining the embodiment of FIG.5;

FIG. 7 is a block diagram showing in detail in part the arrangementshown in FIG. 5;

FIG. 8 is a block diagram showing still another embodiment of theinvention;

FIG. 9 is a chart showing the waveforms observed at various portions ofthe arrangement shown in FIG. 8;

FIG. 10 is a timing chart useful to explain the automatic thresholdsetting performed by the embodiment of FIG. 8;

FIG. 11 is a simplified block diagram of the microcomputer;

FIG. 12 is a table showing the contents of the RAM incorporated in themicrocomputer;

FIG. 13 is a flowchart of the program stored in the microcomputer forcarrying out the initial setting of the threshold levels; and

FIG. 14 is a flowchart of the program stored in the microcomputer forcarrying out the gain control.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

The invention will now be described with reference to the drawings.

The first embodiment of the invention will be described in detail inconnection with FIGS. 3, 4A and 4B. The principle of this embodiment isas follows. High-contrast vertical line components included in thepicture signal (i.e., vertical profile portions of the picture) areextracted and counted. The video signal is gated in units of scanninglines according to the count so that video signals transferred to thedetector in the focus signal extracting means are partly neglectedthereby to prevent the detector from being saturated. This principle isbased on the fact that the picture signal corresponding to the profileportion includes much high-frequency components.

In FIG. 3, the portions including in a lens system 1, a camera circuit2, a terminal 3, an HPF 4, a detector 5, a difference holding circuit 6,a motor drive circuit 7, a motor 8, and terminals 51 and 61 are the sameas the arrangement of the conventional auto-focusing system described inconnection with FIG. 1. The arrangement of the present invention in FIG.3 further includes an electronic switch 10 which functions as a gate, alow-pass filter (LPF) 11, a differentiating circuit 12, a thresholdamplifier 13, a counter 14, a gate signal generator 15, and a syncseparator 16. In the arrangement of FIG. 3, if the gate 10 is keptconductive, the closed loop including the lens system 1 through themotor 8 is exactly the same as the arrangement of the conventionalauto-focusing system shown in FIG. 1, and the explanation will beomitted.

First, means for obtaining the signal representing the number ofvertical profiles in the picture signal will be described. The videosignal produced by the camera circuit 2 is fed through the LPF 11 to thedifferentiating circuit 12, which then provides signals responsive toprofile portions of the picture. The purpose of the LPF 11 is to preventthe differentiating circuit 12 from responding too sharply forout-focused portions of the picture, and the LPF 11 preferably has acut-off frequency of several hundred kHz or lower. Since the output ofthe LPF 11 includes high-frequency components of 100 kHz or higher, itis quite possible to obtain the profile information in the picturesignal.

The output of the differentiating circuit 12 is passed through thethreshold circuit 13 so that profile components having lower contrastthan the predetermined threshold are eliminated, then profile pulses arecounted by the counter 14. The counter 14 is cleared by the outputsignal of the sync separator 16 at an interval of the vertical syncsignal, and thus the counter 14 counts the number of profiles in onefield of picture after the scanning has started at the top left cornerof the frame and before it ends at the bottom right corner of the frame.

FIG. 4A illustrates the production of a picture on the screen, where forpurposes of simplicity only seven scanning lines (1)-(7) are shown.(Actually the standard NTSC television system employs 262.5 scanninglines for one field.) In this picture, scanning line (1) encounters noprofile, scanning line (2) encounters two profiles, and so on, and thecounter 14 will count a total of 12 profiles.

Next, the automatic gain control by the signal representing the numberof profiles will be described. The signal representing the number ofprofiles provided by the counter 14 is passed to the gate signalgenerator 15. If the circuit 15 receives a count value smaller than thepreset value, it operates on the gate circuit 10 to keep conductive, orif the circuit 15 receives a count value larger than the preset value,it operates on the gate circuit 10 with reference to the horizontal andvertical sync signals from the sync separator 16 so that the gateconducts high-frequency video signals at an interval of every twoscanning lines thereby to reduce the entry of the signals to thedetector 5. FIG. 4B shows the result of this operation, where the gate10 is conductive for scanning lines (1), (3), (5) and (7), whereas it isnon-conductive for scanning lines (2), (4) and (6).

In the example of FIG. 3, the gate signal generator 15 operates on thegate 10 to be conductive continuously or to be conductive for every twoscanning lines depending on the count received. However, arrangement maybe made such that the gate circuit operates to conduct the signal forevery three, five or nine scanning lines, or alternatively, the gateoperates for every two or three scanning lines for the upper and lowerportions of the screen and the gate operates continuously for thecentral portion of the screen. The gate signal generator 15 is notdescribed in detail here, however, it can be achieved easily as will bedescribed in detail in connection with the second embodiment. The gatecircuit 10 which is located at the output of the HPF 4 in thearrangement of FIG. 3, however, it may be placed in front of the HPF 4.

The second embodiment of the invention will be described with referenceto FIGS. 5 and 6. In this embodiment, two threshold circuits areprovided at the output of the detector in the focus signal extractingmeans, instead of using the above-mentioned profile counter, with onethreshold value being set to the approximate saturation level of thedetector and with another threshold value being set to the approximatenull signal level of the detector. The outputs of the threshold circuitsare supplied to the gate signal generator so that video signals aregated in units of scanning lines. In FIG. 5, the blocks with referencenumbers 1, 2, 3, 4, 5, 6, 7, 8, 51, 61, 10, and 16 are the sameconstituents as shown in FIG. 3, while the new arrangement furtherincludes a gate signal generator 15', threshold circuits 17 and 18, anda terminal 19. In the arrangement of FIG. 5, if the gate circuit 10 iskept conductive, it is difficult merely by adjusting the gain of thedetector 5 to obtain the characteristics of the focus signal at theoutput of the difference holding circuit 6, as shown by curve (5) inFIG. 6, without occurrence of saturation at the peak, while providing asatisfactory signal range responsive to the helicoid position. Instead,a sufficient signal range cannot be obtained when the number of profilesis small as shown by curve (6), or the signal exceeds the saturationlevel of the detector 5, causing the peak portion of the curve to beflattened, when the number of profiles is large as shown by curve (4) inFIG. 6. In the arrangement of FIG. 5, the threshold circuit 17 has beenset to have a threshold of α in proximity to the saturation level of thedetector 5, and the threshold circuit 18 has been set to have athreshold of β in proximity to the null signal level of the detector 5.The gate signal generator 15' operates on the gate circuit 10, withreference to the outputs of the threshold circuits 17 and 18 responsiveto the focus signal at the terminal 51, to be conductive ornon-conductive. Thus the number of pulses supplied from the HPF 4 to thedetector 5 is reduced, whereby the virtual gain of the detector 5 iscontrolled.

In this arrangement, when the focus signal is below the threshold β, thegate signal generator 15' operates on the gate circuit 10 to becomeconductive more frequently, while when the focus signal exceeds thethrehsold α, the gate circuit 10 is made conductive less frequently,whereby the focus signal is maintained within the voltage range betweenβ and α, i.e., the dynamic range of the detector 5.

FIG. 7 shows in block diagram an example of the gate signal generator15' for controlling the gate circuit 10, and the arrangement includes acounter 151, a programmable decoder 152, an up/down counter 153, an ANDgate 154, a means 155 for detecting the variation of the contents of theup/down counter 153, and gate circuits 156 and 157. The counter 151receives at its count terminal T the horizontal sync signal from thesync separator 16, and at its reset terminal R the vertical sync signal(one pulse per field), and therefore the contents of the counter whichappear at it outputs Q1-Q8 indicate the scanning line number. Theup/down counter 153 is cleared when the auto-focusing operation starts,thereafter it is incremented in response to the output the thresholdcircuit 17 through the gate circuit 156, i.e., each time the focussignal exceeds the threshold α, while it is decremented in response tothe output of the threshold circuit 18 through the gate circuit 157,i.e., each time the focus signal goes down below the threshold β.

The programmable decoder 152 carries out control in co-operation withthe AND gate 154 in accordance with the predetermined rule such that thegate circuit 10 conducts all horizontal scanning signals, every twosignals or every three signals depending on the contents of the up/downcounter 153. As a particular example, there is arranged the gainswitching of seven steps ranging from passing all scanning lines topassing one scanning line at an interval of 64 lines. In thisarrangement, output pulses from the HPF 4 are picked off in units ofscanning lines by control of the gate circuits 156 and 157 each time thegain switching operation occurs. The variation detecting means 155operates on the gate circuits 156 and 157 to be conductive when theup/down counter 153 does not vary its contents, while the circuits aremade non-conductive only at the moment when the up/down counter 153varies the contents, whereby the up/down counter 153 does not count upor down when the focus signal resides between the thresholds α and β,but it counts up or down continuously when the focus signal is above thethreshold α or below the threshold β, respectively. The variationdetecting means 155 can easily be designed by those who are skilled indigital circuit technologies and explanation thereof will be omitted.

The operation of the auto-focusing system shown in FIG. 5 will furtherbe described in connection with FIG. 6. Assuming that the auto-focusingoperation starts with the lens system 1 located initially at theproximity position, the focus signal resides below the threshold β,causing the gate circuit 10 to pass HPF output pulses for all horizontalscanning lines, and the focus signal voltage starts to ascend along thecurve (4) in FIG. 6. When the lens position has reached point PA atwhich the threshold circuit 17 detects that the focus signal goes beyondthe threshold α, the up/down counter 153 is incremented. Then, due tothe action of the programmable counter 152, the terminal 19 providessignals for every two horizontal scanning lines, causing the gatecircuit 10 to pass approximately half the output pulses thereby toreduce the focus signal level by half. After that, the focus signalvoltage will ascend along curve (5) until the lens position reachespoint PB which is the exact focus point for the object, and theauto-focusing operation completes.

Although in the above example the gain was switched only once, it willbe appreciated that the gain is switched again when the focus signalvoltage exceeds the threshold α in ascending along the curve (5). Alsoin the above example, the focus signal started to ascend along the curve(4) for passing all scanning lines since the initial value of the focussignal was smaller than the threshold β. However, it is not important topass all scanning lines at the beginning of the operation, but what isimportant is to establish the gain so that the focus signal residesbetween the thresholds α and β before starting the operation. Theascending operation accompanied by gain switching is not onlyadvantageous for maintaining the focus signal within the dynamic rangeof the detector 5 continuously, but also provides an accurate ascendingoperation since it takes the steepest ascending path while the focussignal is small and gradually it swaps for smaller gain so that thedetector 5 provides a sufficient voltage difference for the differenceholding circuit 6. This is obvious from the comparison with another gaincontrol method, in that if the focus signal at the exact focal positionPB is predicted by some means and the ascending operation starts alongthe curve (5) in FIG. 6, the gradient of the ascending slope between thestart position and the lens position PA is half that of the presentinvention.

Although it was not mentioned in the above description, the magnitude ofthe focus signal is significantly reduced by the gain switchingoperation, causing the difference holding circuit 6 to provide an outputvoltage which directs a reverse rotation of the motor 8. However, it isobvious that the motor drive circuit 7 should be arranged so that themotor 8 is rotated continuously in the same direction even for suchtransitional focus signal. This operation takes place in such a way thatwhen the gain switching has occurred, the focus signal immediately afterthe switching is set as the initial value. The motor 8 is kept runningin the same direction as before, and the focus signal obtainedsubsequently is compared with the initial value. If the focus signal isfound increasing, the normal ascending control is restored, or if thesignal is found decreasing, the lens position at the time of gainswitching is assumed to be the exact focal position and the lens systemis moved back and held at that position. By the foregoing method, asatisfactory auto-focusing operation is achieved.

The programmable decoder 152 may be provided with an additional functionthat conducts no horizontal scanning lines for the contents of thecounter 151 ranging, for example, from 0 to 79 and from 185 to 262.5irrespective of the contents of the up/down counter 153, so that theoutput signal of the HPF 4 which generates the focus signal isrestricted to the area of 106 scanning lines in the central portion ofthe screen. Then gain control by reducing the number of scanning linesis carried out within the area, and the picture can be focused for thelimited frame, thereby eventually improving the operationability of thevideo camera incorporating the auto-focusing system.

Still another embodiment of the invention will be described in detailwith reference to FIGS. 8, 9 and 10. In FIG. 8, the constituents withreference numbers 1-5, 7, 8, 10, and 15'-18 are the same as those shownin FIG. 5. The detector 5, in this embodiment, consists of a full-waverectifier 5a, an integrator 5b and an A/D converter 5c. The arrangementfurther includes a control circuit 20 which functions similarly to thedifference holding circuit 6 in FIG. 5 in digital fashion (for detailsof this circuit, refer to U.S. Pat. No. 4,320,417, entitled, "AutomaticFocusing System for Video Camera", assigned to the applicant of thepresent invention) and a timing generator 21. The output 158 of the gatesignal generator 15' indicates the gain switching to the control circuit20. The timing generator 21 provides reset pulses 21a (FIG. 9, (a)) forthe integrator 5b and conversion timing pulses 21b (FIG. 9, (d)) for theA/D converter 5c at an interval of the vertical sync signal in the TVsignal. The integrator 5b integrates the input signal during a certainperiod which ends when a reset pulse is issued by the circuit 21 so asto form a signal representing the difinition of the picture at eachinterval of the vertical sync signal. The reason why the detector 5 isso arranged is that the focus signal is reset to the initial value ateach vertical sync signal to minimize the time constant of the detector5 thereby to produce the focus signal for each picture exactlyresponsive to the lens position at that time. The gate circuit 10 may beplaced between the full-wave rectifier 5a and the integrator 5b. Theoutput of the integrator 5b will be termed "focus signal" hereinafter.The A/D converter 5c converts the analog voltage signal from theintegrator 5b into digital signal and supplies it to the control circuit20.

FIG. 9 (b) shows the envelope of the output signal from the HPF 4, whichis actually made up of numerous fine pulses on the order of microsecondseach representing a profile in the picture. The envelope waveforms existonly during a limited period of G1-H1 and G2-H2, since the gate circuit10 conducts video signals corresponding to the central portion of thescreen in accordance with the programmable decoder 152 in FIG. 5 asmentioned previously.

When the gate 10 is conductive, the arrangement including the lenssystem 1 through the detector 5 operates identically to those of theconventional auto-focusing system as described in connection with FIG.5, with the exception that the detector output is converted signal bythe A/D converter 5c into a digital voltage representing the definitionof the picture which appears at terminal 51 (FIG. 9, (c)), and thresholdcircuits 17 and 18 and a control circuit 20 executes a digitalprocessing. If this digital voltage is at the saturation level of thedetector 5, which is mainly determined by the saturation level of theintegrator 5b, the gate signal generator 15', in response to the outputof the threshold circuit 17 and with reference to the horizontal andvertical sync signals from the sync separator 16, operates on the gatecircuit 10 to conduct video signals for less horizontal scanning linesso as to reduce input signals to the detector 5. Conversely, if theoutput of the detector 5 is at the null signal level, the gate signalgenerator 15, in response to the output of the threshold circuit 18 andwith reference to the horizontal and vertical sync signals from the syncseparator 16, operates on the gate circuit 10 to conduct video signalsfor more horizontal scanning lines so as to increase input signals tothe detector 5. In this case, the number of operations of the gatecircuit 10 is switched each time the detector output exceeds thethreshold value. Thus the output of the detector 5 is controlled to havethe optimum voltage level and the control circuit 20 maintains asatisfactory condition for determination, whereby the ascendingoperation on the curve of the focus signal is carried out withoutfailure. In the operation, however, the focus signal immediatelyfollowing the switching of the number of gate operations cannot providea difference with the successive focus signal. This is because thedifference between the two focus signals includes the difference ofnumber of gate operations more than the component caused by thevariation of the definition produced by the movement of the lens system1, resulting in an incorrect determination. Therefore, in this case, theascending operation should be restarted with the focus signalimmediately following the switching of the number of gate operationsbeing set as the initial value. The motor may be stopped temporarilybefore and after this operation, or may be kept running in the samedirection.

The following will describe how to set the threshold values for thethreshold circuits 17 and 18. The threshold values can be set topredetermined fixed values if the saturation level and null signal levelof the detector 5 are stable against environmental changes such as theambient temperature or if the detector 5 has a sufficient dynamic rangefor allowing a margin of threshold setting. However, these conditionsare not generally met in practical design, and it is desirable to setthe threshold values appropriately so that the dynamic range of thedetector 5 is fully used in operation.

The means for setting the threshold values will be described inconnection with FIG. 10. In FIG. 10 (c), levels (A) and (B) define thedynamic range of the detector which is restricted by the power voltage,where (A) is the null signal level and (B) is the saturation level. Whenthe auto-focusing system is turned on (see FIG. 10 (a)), the set upcontrol is carried out for the threshold circuit 17 as shown in FIG. 10(b). More particularly, the control circuit 20 issues an integratorreset inhibit signal 20a to the timing generator 21, which then suspendsthe output of the reset signal (see FIG. (a)) to the integrator 5bduring the period of 0-T1. Then, the output of the integrator 5b, whichis normally reset at each vertical sync signal to provide the nullsignal level (A), comes to the saturation level (B) after a certainwhile as shown by (1) in FIG. 10 (c). Accordingly, the voltage receivedby the A/D converter 5c on expiration of that time can be assumed to bethe saturation level (B). The threshold circuit 17 is set to thisvoltage or the voltage added by a margin (i.e., level (C)) as thesaturation threshold value (high threshold value). After the higherthreshold has been set, the integrator reset inhibit signal from thecontrol circuit 20 goes off (at T2), then control proceeds to thesetting of the threshold circuit 18 as shown in FIG. 10 (b). Theintegrator 5b is reset at each vertical sync signal and provides theoutput as shown by (2) in FIG. 10. The output of the integrator 5b issubjected to A/D conversion repeatedly by the circuit 5c in response tothe command from the control circuit 20 at a period of about 2 ms whichis shorter than the period of the vertical sync signal, and the minimumvalue of the converted voltage or the value added by a margin (i.e.,level (2)) is set as the null signal threshold value (low thresholdvalue) in the threshold circuit 17. After the threshold circuits 17 and18 have been set, control proceeds to the ascending operation as shownin FIG. 10 (b), and the auto-focusing is started.

During the ascending operation in accordance with the threshold values,when the output of the integrator 5b exceeds the level (C) of FIG. 10(at T3), the threshold circuit 17 operates on the gate circuit 10 toreduce input signals to the detector 5, and if the integrator outputgoes down below the level (D), the threshold circuit 18 operates on thegate circuit 10 to increase input signals to the detector 5. Thisthreshold setting is carried out each time the auto-focusing system isturned on and also when the thermometer detects the temperaturevariation inside the system. Thus the automatic gain control circuitoperates stably even if the dynamic range of the detector varies due tounequal circuit components and the like. The control circuit 20 is knownin the art and the explanation thereof is omitted. (Refer to theabovementioned U.S. Pat. No. 4,320,417.)

Next, the following will describe an embodiment wherein the controlcircuit 20, the threshold circuits 17 and 18, the timing generator 11,and part of the gate signal generator 15' shown in FIG. 8 are replacedwith a microcomputer. The microcomputer used here may be a generalpurpose microcomputer available in the market such as, for example, a4-bit microcomputer HMCS-44 or HMCS-45 manufactured by Hitachi, Ltd.

FIG. 11 shows in brief the structure of the microcomputer. Themicrocomputer generally shown by 80 includes the equivalent functions ofthe control circuit 20, the threshold circuits 17 and 18, and the timinggenerator 21 shown in FIG. 8, and further, part of the gate signalgenerator 15' including the up/down counter 153, the detector 155 andthe gate circuits 156 and 157 shown in FIG. 7. In this embodiment, thegate signal generator is constituted by a counter 151, a programmabledecoder 152 and an AND gate 154. The microcomputer 80 is a generalpurpose device including a CPU 81, a ROM 82, a RAM 83, an I/O circuit84, a D/A converter 85, and a bus 86. The ROM 82 stores the program forautomatic focusing, the program for gain control (gate control), and theprogram for setting the initial threshold values for the gain control.

The following will describe the program for gain control and the programfor setting the initial threshold values for the gain control. FIG. 12shows part of the storage area of the RAM 83, where the locations withaddresses 100-106 store data, in a certain number of bits, representingthe current focus signal, the previously A/D converted focus signal, themaximum focus signal, the minimum focus signal, the high thresholdvalue, the low threshold value, and the current gain (i.e., the signalcontrolling the number of operations of the gate 10), respectively. Datastored in addresses 104 and 105 correspond to the threshold values forthe threshold circuits 17 and 18 shown in FIGS. 5, 7 and 8 in theprevious embodiment, and data stored in address 106 corresponds to thecontents of the up/down counter 153 shown in FIG. 7. The current focussignal stored in address 100 corresponds to the digital focus signalprovided by the A/D converter shown in FIG. 8.

Referring to FIG. 13, the program for setting the initial thresholdvalues is initiated by turning on the video camera, and the highthreshold value will first be set. An integer, e.g., "64", is set to anappropriate counter within the microcomputer 80. Then, the microcomputer80 disables the output of the integrator reset pulse 21a to theintegrator 5b and provides timing pulses in a period of about 2 ms tothe A/D converter 5c. In response to each timing signal, the focussignal is stored in address 100 and at the same time the maximum focussignal in address 102 is updated. Next, the contents of the counterwhich has been set previously are checked, and if it contains nonzero,it is decremented by one and the same operation is repeated. When thecounter contents become zero, the high threshold value is set basing onthe maximum focus signal stored in address 102 and it is stored inaddress 104.

Subsequently, the initial low threshold value will be set. First,integer "64" is set in an appropriate counter within the microcomputer80. Then, the integrator reset pulse 21a to the integrator 5b isenabled, and timing pulses in a period of about 2 ms are provided forthe A/D converter 5c. Then, the focus signal provided by the A/Dconverter 5c is stored in address 100 and the minimum focus signal inaddress 103 is updated. Here, the updating signifies that data stored inaddresses 100 and 103 are compared and the contents of address 103 arereplaced by the smaller one. Next, the contents of the counter arechecked, and if it contains nonzero, it is decremented by one and thesame operation is repeated. When the counter contents become zero, thelow threshold value is set basing on the minimum focus signal in address103, and it is stored in address 105. Upon completion of the program forsetting the initial threshold values, the program for auto-focusing willbe executed.

When the program for auto-focusing (this program is not related to theinvention and will not be described here) has started, themicro-processor receives the focus signal from the A/D converter 5c.Upon reception of the focus signal, the gain control routine isinitiated as shown in FIG. 14. The focus signal is stored in address 100of the RAM 83 as a current focus signal and at the same time it iscompared with the high threshold value which has been set previously. Ifthe signal is smaller than the high threshold value, it is compared withthe low threshold value. If the signal is larger than the low thresholdvalue, control returns to the auto-focusing program without changing thecurrent gain stored in the RAM 106. If the signal is larger than thehigh threshold value, the current gain (which is stored in address 106of RAM 83 and controls the number of operation of the gate 10) ischecked whether it is the minimum value or not. If the current gain isfound minimum, control returns to the auto-focusing program. If it isnot the minimum gain, the current gain stored in address 106 is degradedby one step. In response to the next timing pulse from the A/Dconverter, the microcomputer receives a digital focus signal and storesit in address 101 as a previous focus signal, then control returns tothe auto-focusing program.

Returning to the earlier stage of the gain control routine, if the focussignal is found smaller than the low threshold value, the current gainstored in address 105 of the RAM 83, i.e., the number of gateoperations, is checked whether it is maximum or not. If the current gainis found maximum, control returns to the auto-focusing program. If it isnot the maximum gain, it is upgraded by one step and stored in address106. Then, in response to the next timing signal the contents of address106 is converted into digital signal and stored in address 101 as aprevious focus signal.

It will be understood from the foregoing description how the number ofoperation of the gate 10 is controlled and initial threshold values areset using the microcomputer.

According to the present invention, as described above, the optimumfocus signal level can be obtained by controlling the input to thedetector even for the case where a satisfactory ascending operationcould not be carried out in the conventional system due to aninsufficient dynamic range of the detector, and a satisfactory ascendingoperation is made possible. Moreover, the threshold values for switchingthe gain are re-set each time the system is turned on and, consequently,the gain switching control is not affected by unequal circuit componentsand variation of characteristics due to ageing and the thermalenvironment.

We claim:
 1. In an auto-focusing system for a video camera comprising:avideo camera for providing a video signal; focus signal extracting meansfor receiving the video signal from said video camera and for extracteda focus signal representing the degree of matching of focusing andproviding an output indicative thereof; and control means responsive tosaid focus signal extracting means for controlling the lens system ofsaid video camera so that the output of said focus signal extractingmeans has a predetermined value, the improvement comprising: gate meansconnected between said video camera and said focus signal extractingmeans; and gate control signal generating means responsive to at leastone of said video camera and said focus signal extracting means forgenerating signals which make said gate means conductive ornon-conductive depending on the quantity of high-frequency componentsincluded in said video signal.
 2. An auto-focusing system according toclaim 1, wherein said gate control signal generating means comprisescounter means for receiving said video signal from said video camera andfor counting the number of profiles of a picture seen in the horizontalscanning direction in said video signal.
 3. An auto-focusing systemaccording to claim 2, wherein said counter means comprises:a low-passfilter for receiving said video signal from said video camera; adifferentiating circuit connected to said low-pass filter; a thresholdcircuit connected to said differentiating circuit; and a counterconnected to said threshold circuit.
 4. An auto-focusing systemaccording to claim 3, wherein said counter is cleared at an interval ofone field of said video signal.
 5. An auto-focusing system according toclaim 1, wherein said gate control signal generating meanscomprises:threshold means for varying the output of said focus signalextracting means; and a gate signal generating circuit for receiving theoutput of said threshold means and for varying the period of theconductive and non-conductive operation of said gate means in responseto the output of said threshold means.
 6. An auto-focusing systemaccording to claim 5, wherein said threshold means comprises a firstthreshold circuit having a threshold value in proximity of thesaturation level of said focus signal extracting means and a secondthreshold circuit having a threshold value in proximity of the nullsignal level of said focus signal extracting means.
 7. An auto-focusingsystem according to claim 5 or 6, wherein the conductive period of saidgate means is substantially equal to a horizontal scanning period andthe non-conductive period of said gate means is integral multiples(including zero) of said horizontal scanning period.
 8. In anauto-focusing system for a video camera comprising:a video camera; ahigh-pass filter which receives a video signal from said video cameraand filters high frequency components of said video signal; a meanswhich receives the output of said high-pass filter and extracts a focussignal representing the degree of matching of focusing from saidhigh-frequency components of said video signal; and a control meanswhich receives the output of said extracting means and controls a motorfor driving a lens system of said video camera so that said focus signalis made maximum, the improvement comprising: a gate connected betweensaid high-pass filter and said focus signal extracting means; and ameans which receives said focus signal and provides said gate with acontrol signal for picking off outputs of said high-pass filter in unitsof horizontal scanning lines of said video signal in response to theamplitude of said focus signal.
 9. An auto-focusing system according toclaim 8, wherein said control signal supply means comprises:a means forcomparing said focus signal with a threshold value; and a gate signalgenerating means which receives the output of said comparison means andgenerates conductive or non-conductive operation signal for said gate inresponse to said output of said comparison means.
 10. An auto-focusingsystem for a video camera according to claim 8 or 9, wherein said focussignal extracting means comprises a rectifier connected to saidhigh-pass filter and an integrating circuit connected to said rectifier,said system further comprising a timing pulse generating circuit whichgenerates pusles for resetting said integrating circuit at an intervalof one field of said video signal.
 11. An auto-focusing system for avideo camera wherein said video camera is focused automatically bymoving the lens system of said camera by a motor, comprising:a means forextracting a focus signal representing the degree of matching offocusing of said video camera from a video signal from said videocamera; a gate means for conducting or non-conducting said video signalto said focus signal extracting means; and a control means whichreceives said focus signal from said focus signal extracting means andprovides a first control signal for auto-focusing to a drive means forsaid motor and provides said gate means with a second control signal forintroducing said video signal in units of horizontal scanning linesdepending on the magnitude of said focus signal.
 12. An auto-focusingsystem for a video camera according to claim 11, wherein said gate meanscomprises:a gate connected in a signal path of said video signal; and agate signal generating circuit which receives said second control signalfrom said control means and provides gate pulses to said gate so thatsaid gate is made conductive or non-conductive.
 13. An auto-focusingsystem for a video camera according to claim 12, wherein said gatesignal generating circuit comprises:a counter which counts thehorizontal sync signal of said video signal and is cleared by thevertical sync signal of said video signal; and a programmable decoderwhich receives the parallel output of said counter and provides gatepulses for making said gate conductive or non-conductive in response tosaid second control signal.
 14. An auto-focusing system for a videocamera according to claim 11, 12 or 13, wherein said control meansstores a high threshold value in proximity to the saturation level ofsaid focus signal extracting means and a low threshold value inproximity to the null signal level of said focus signal extractingmeans, said control means including comparing means for comparing saidfocus signal with said first and second threshold values and forproviding said second control signal.
 15. An auto-focusing system for avideo camera according to claim 14, wherein said focus signal extractingmeans comprises at least an integrating circuit, said control meansgenerating a third control signal for controlling the integration periodof said integrating circuit.